home *** CD-ROM | disk | FTP | other *** search
/ The Sunday Times: The Month 2004 August / The Sunday Times - The Month 2004-08.iso / pc / engine / shell / shell.swf / scripts / DefineSprite_78 / frame_1 / DoAction.as
Encoding:
Text File  |  2004-07-06  |  2.7 KB  |  86 lines

  1. function hideCloseButtons()
  2. {
  3.    buttons_mc.gotoAndStop(1);
  4. }
  5. stop();
  6. showHideCloseBtn = function(val)
  7. {
  8.    buttons_mc._visible = val;
  9. };
  10. showCloseButton = function(overlayObj)
  11. {
  12.    switch(overlayObj.closeBut)
  13.    {
  14.       case "video":
  15.          overlayObj.isFullscreen != true ? showHideCloseBtn(false) : showHideCloseBtn(true);
  16.          buttons_mc.onRelease = function()
  17.          {
  18.             var lastOverlay = Tardis.OverlayController.getLastOverlay();
  19.             lastOverlay.ownerMc.videoCloseFullscreen();
  20.             Tardis.closeButton_mc.showHideCloseBtn(false);
  21.             Tardis.TardisInterface.showInterface(2,true);
  22.          };
  23.          break;
  24.       case "advert":
  25.          showHideCloseBtn(true);
  26.          buttons_mc.onRelease = function()
  27.          {
  28.             Tardis.OverlayController.removeLastOverlay();
  29.             Tardis.UsageData.addAdvertEndEntry();
  30.          };
  31.          break;
  32.       case "sponsor":
  33.          showHideCloseBtn(true);
  34.          buttons_mc.onRelease = function()
  35.          {
  36.             Tardis.OverlayController.removeLastOverlay();
  37.             Tardis.UsageData.addAdvertEndEntry();
  38.          };
  39.          break;
  40.       case "promo":
  41.          showHideCloseBtn(true);
  42.          buttons_mc.onRelease = function()
  43.          {
  44.             Tardis.OverlayController.promoOverlay.kill();
  45.             Tardis.UsageData.addAdvertEndEntry();
  46.          };
  47.          break;
  48.       case "help":
  49.          showHideCloseBtn(true);
  50.          buttons_mc.onRelease = function()
  51.          {
  52.             Tardis.OverlayController.removeLastOverlay();
  53.             var lastOverlay = Tardis.OverlayController.getLastOverlay();
  54.             lastOverlay.ownerMc.videoCloseFullscreen();
  55.             Tardis.closeButton_mc.showHideCloseBtn(false);
  56.             Tardis.TardisInterface.showInterface(2,true);
  57.          };
  58.          break;
  59.       case "fullscreen_still":
  60.          showHideCloseBtn(true);
  61.          buttons_mc.onRelease = function()
  62.          {
  63.             Tardis.OverlayController.removeLastOverlay();
  64.          };
  65.          break;
  66.       default:
  67.          if(overlayObj.closeBut != null)
  68.          {
  69.             trace("NO DEFAULT ACTION SET UP FOR THIS BUTTON TYPE (" + overlayObj.closeBut + ")");
  70.             break;
  71.          }
  72.    }
  73.    buttons_mc.onRollOver = function()
  74.    {
  75.       this.close_btn.btnCopy.col = new Color(this.close_btn.btnCopy);
  76.       this.close_btn.btnCopy.col.setRGB(6443288);
  77.    };
  78.    buttons_mc.onRollOut = function()
  79.    {
  80.       this.close_btn.btnCopy.col = new Color(this.close_btn.btnCopy);
  81.       this.close_btn.btnCopy.col.setRGB(12235927);
  82.    };
  83.    buttons_mc.gotoAndStop(overlayObj.closeBut);
  84. };
  85. hideCloseButtons();
  86.